import 'package:efood_multivendor/util/dimensions.dart';
import 'package:efood_multivendor/util/styles.dart';
import 'package:flutter/material.dart';

class CustomStepper extends StatelessWidget {
  final bool isActive;
  final bool haveLeftBar;
  final bool haveRightBar;
  final String title;
  final bool rightActive;
  CustomStepper(
      {required this.title,
      required this.isActive,
      required this.haveLeftBar,
      required this.haveRightBar,
      required this.rightActive});

  @override
  Widget build(BuildContext context) {
    LinearGradient _color = isActive
        ? LinearGradient(
            colors: [Color(0xffff8022), Color(0xffff2222)],
          )
        : LinearGradient(colors: [
            Theme.of(context).disabledColor,
            Theme.of(context).disabledColor
          ]);
    LinearGradient _right = rightActive
        ? LinearGradient(
            colors: [Color(0xffff8022), Color(0xffff2222)],
          )
        : LinearGradient(colors: [
            Theme.of(context).disabledColor,
            Theme.of(context).disabledColor
          ]);

    return Expanded(
      child: Column(children: [
        Row(children: [
          Expanded(
              child: haveLeftBar
                  ? Divider(
                      color: Theme.of(context).colorScheme.secondary,
                      thickness: 2,
                    )
                  : SizedBox()),
          Padding(
            padding: EdgeInsets.symmetric(vertical: isActive ? 0 : 5),
            child: Icon(isActive ? Icons.check_circle : Icons.blur_circular,
                color: Theme.of(context).colorScheme.secondary,
                size: isActive ? 25 : 15),
          ),
          Expanded(
              child: haveRightBar
                  ? Divider(
                      color: Theme.of(context).colorScheme.secondary,
                      thickness: 2)
                  : SizedBox()),
        ]),
        Text(
          title + '\n',
          maxLines: 2,
          overflow: TextOverflow.ellipsis,
          textAlign: TextAlign.center,
          style: sfMedium.copyWith(
              color: Theme.of(context).colorScheme.secondary,
              fontSize: Dimensions.fontSizeExtraSmall),
        ),
      ]),
    );
  }
}
